package com.woniu.swagger.controller;

import com.woniu.swagger.common.Result;
import com.woniu.swagger.model.Spot;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("spot")
@Api(tags = "景区相关接口", description = "提供景区相关的 Rest API")
public class SpotController {
    @ApiOperation(value ="新增景点")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "spot", value = "景区对象", dataType = "Spot")
    })
    @PostMapping("addSpot")
    public Result addSport(Spot spot){
        // 数据持久化
        return Result.success("新增成功");
    }

    @ApiOperation(value ="修改景点")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "spot", value = "景区对象", dataType = "Spot")
    })
    @PostMapping("modifySpot")
    public Result modifySport(Spot spot){
        // 数据持久化
        return Result.success("修改成功");
    }
}
